#pragma once

#include <iostream>
#include <allegro5\allegro.h>
#include "Vector2.h"
#include "Rectangle.h"

class GameEntity
{

protected:
	ALLEGRO_BITMAP *image;
	bool visible;
	Vector2 position;
	Vector2 scale;

public:
	GameEntity();
	void virtual Init(ALLEGRO_BITMAP* image, Vector2 position);
	void SetPosition(Vector2 v) { position.Set(v.X, v.Y);}
	Vector2 GetPosition(){ return position;}

	ALLEGRO_BITMAP* GetImage(){return image;}
	void SetImage(ALLEGRO_BITMAP* img);

	CustomRectangle GetCollisionRect(){ return CustomRectangle((int)position.X, (int)position.Y,  al_get_bitmap_width(image), al_get_bitmap_height(image));};

	void Invisible() {visible = false;}
	void Visible() { visible = true;}
	bool IsVisible() {return visible;}

	void virtual Update();
	void virtual Update(float time);
	void virtual Draw();
};